import {BasicColumn} from '/@/components/Table';
import {FormSchema} from '/@/components/Table';
import { rules} from '/@/utils/helper/validator';
import { render } from '/@/utils/common/renderUtils';
import {JVxeTypes,JVxeColumn} from '/@/components/jeecg/JVxeTable/types'
//列表数据
export const columns: BasicColumn[] = [
    {
    title: '序号',
    align:"center",
    dataIndex: 'no'
   },
   {
    title: '标题',
    align:"center",
    dataIndex: 'title'
   },
   {
    title: '详细规定',
    align:"center",
    dataIndex: 'detail'
   },
   {
    title: '对应文件',
    align:"center",
    dataIndex: 'wordString'
   },
];
//查询数据
export const searchFormSchema: FormSchema[] = [
];
//表单数据
export const formSchema: FormSchema[] = [
  {
    label: '序号',
    field: 'no',
    component: 'Input',
    dynamicRules: ({model,schema}) => {
          return [
                 { required: true, message: '请输入序号!'},
          ];
     },
  },
  {
    label: '标题',
    field: 'title',
    component: 'Input',
    dynamicRules: ({model,schema}) => {
          return [
                 { required: true, message: '请输入标题!'},
          ];
     },
  },
  {
    label: '详细规定',
    field: 'detail',
    component: 'InputTextArea',//TODO 注意string转换问题
    dynamicRules: ({model,schema}) => {
          return [
                 { required: true, message: '请输入详细规定!'},
          ];
     },
  },
  {
    label: '对应文件',
    field: 'word',
    component: 'JUpload',
    componentProps:{
     }
  },
];
//子表单数据
//子表表格配置
export const znzfScoreStandardItemColumns: JVxeColumn[] = [
    {
      title: '名称',
      key: 'name',
       type: JVxeTypes.input,
      width:"200px",
      placeholder: '请输入${title}',
      defaultValue:'',
      validateRules: [{ required: true, message: '${title}不能为空' }],
    },
    {
      title: '分数',
      key: 'score',
       type: JVxeTypes.input,
      width:"200px",
      placeholder: '请输入${title}',
      defaultValue:'',
      validateRules: [{ required: true, message: '${title}不能为空' }],
    },
    {
      title: '备注',
      key: 'note',
      type: JVxeTypes.textarea,
      width:"200px",
      placeholder: '请输入${title}',
      defaultValue:'',
    },
  ]
